#include <iostream>
using namespace std;
int main()
{
	long long s=0,jc=1;
	int n;
	cin >> n;//3
	for(int i=1;i<=n;i++)//1 2 3
	{
		jc *= i;//1*1*2*3
		s += jc;//0+1*1+1*2+1*2*3
	}
	cout << s; 
	return 0;
}

